package org.javaboy.springdoc_demo.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

@RestController
@RequestMapping("/book")
public class BookController {

    /**
     * 这个 Principal 参数会自动注入进来，类似于 HttpServletRequest
     * @param principal
     */
    @GetMapping("/hello")
    public void hello(Principal principal) {
        System.out.println("principal = " + principal);
    }
}
